package cn.changhong.user.util;

import org.springframework.security.core.GrantedAuthority;

/**
 * @Author zz
 * @Date
 **/
public class GrantedAuthorityImpl implements GrantedAuthority {
    String role;
    public GrantedAuthorityImpl(int roleId){
        if(roleId == 1){
            this.role="ROLE_SuperAdmin" ;
        }else if(roleId == 2){
            this.role="ROLE_Admin" ;
        }else {
            this.role="ROLE_CommonUser";
        }

    }
    @Override
    public String getAuthority() {
        return role;
    }
}
